🆕 Add Reading Slide-level info & Simple Plugins for Visualization Tool#789
Draft
🆕 Add Reading Slide-level info & Simple Plugins for Visualization Tool#789
Conversation
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #789 +/- ##
===========================================
- Coverage 99.37% 97.49% -1.89%
===========================================
Files 71 74 +3
Lines 9176 9389 +213
Branches 1197 1221 +24
===========================================
+ Hits 9119 9154 +35
- Misses 31 203 +172
- Partials 26 32 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
shaneahmed
reviewed
Mar 15, 2024
| base_doc.add_root(popup_table) | ||
| base_doc.add_root(slide_info) | ||
| base_doc.add_root(extra_layout) | ||
| base_doc.title = "Tiatoolbox Visualization Tool" |
Member
There was a problem hiding this comment.
Suggested change
| base_doc.title = "Tiatoolbox Visualization Tool" | |
| base_doc.title = "TIAToolbox Visualization Tool" |
shaneahmed
reviewed
Mar 15, 2024
| @@ -0,0 +1 @@ | |||
| """plugins and templates for bokeh visualization app.""" | |||
Member
There was a problem hiding this comment.
Suggested change
| """plugins and templates for bokeh visualization app.""" | |
| """Plugins and templates for bokeh visualization app.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds in a feature from the most recent version of TIAViz to allow a .csv to be provided in the slides folder that can contain slide level predictions or ground truth labels/other slide level info.
When loading a slide in the UI, if the slide name (including suffix) appears in the "Image File" column of the .csv, any information in the corresponding row of the .csv will appear in the UI below the main window in a nicely formatted string.
Only the "Image File" column is required for this to work, the rest of the columns can be anything you need to have displayed.
Also adds entry in documentation describing feature.
In response to Mostafa's request for more flexibility in what sort of extra info you can add to the UI, i've also added some basic plugin functionality to this PR (and converted to draft for now as it has become much larger and needs tests/docs to be added over the coming weeks, and may be tweaked a bit).
Plugins are defined as a class following an ABC and can add a collection of bokeh UI elements and/or plots below the main view window (and can potentially also insert additional UI elements into the main controls section). This is pretty flexible and can add some quite complex extras in there as you have all the power of bokeh to work with.
I have added 3 pre-built plugins that will cover some use-cases, and provide examples which users can adapt or take inspiration from to make their own custom plugin.
The 3 provided are:
ImageGrid: if each slide has a folder of images associated with it, this plugin will show the images in a grid-like layout below the slide view window.
BarPLotGrid: makes a gridlike layout of bar charts from csv files associated with each slide
StatsPlot: adds some UI elements to show a histogram showing the distribution of a property over the annotations in the selected box on the slide window
To add plugins when launching the tool, you can add one or more --plugin arguments each with a path pointing to the file where the plugin class is.